//  

#region

#endregion

#region

using Microsoft.Practices.Unity;
using pushbomb.composite.core;

#endregion

namespace pushbomb.composite.widgetmodel
{
    /// <summary>
    /// 
    /// </summary>
    public sealed class DynamicLayoutModule : PrismModuleBase
    {
        /// <summary>
        /// Initializes a new instance of the <see cref="DynamicLayoutModule"/> class.
        /// </summary>
        /// <param name="fs">The fs.</param>
        public DynamicLayoutModule(IUnityContainer fs)
            : base(fs)
        {
            Container.RegisterType<IView, CompositeRegionContentControl>();
            Container.RegisterType<IViewModel, WidgetViewModel>("widgetVM");
            Container.RegisterType<IPresenter, WidgetModelPresenter>(
                new ContainerControlledLifetimeManager());
        }

        public override void Initialize()
        {
            var resolved =
                Container.Resolve<IPresenter>();
            if (resolved != null)
                resolved.PopulateViewRegion(10);
        }
    }
}